package com.study.demo.security;

import org.springframework.social.connect.Connection;
import org.springframework.social.connect.ConnectionSignUp;
import org.springframework.stereotype.Component;

/**
 * 社交登陆自动创建用户
 * @author LiYongKui
 * @version 1.0
 * @date 2021/4/2 16:33
 */
@Component
public class DemoConnectionSignUp implements ConnectionSignUp {
    @Override
    public String execute(Connection<?> connection) {
        //根据社交用户信息创建用户并返回用户唯一标识
//        return connection.getDisplayName();
        return "admin";
    }
}
